import { createRouter, createWebHistory } from 'vue-router'



const routes = [
  {
    path: "/Login",
    name: 'Login',
    component:  ()=>import("@/views/login.vue"),
  },
  {
    path: "/",
    component: ()=>import("@/views/sys/Home.vue"),
    redirect: "main",
    children: [
      {
        path: '/main',
        name: 'main',
        component: ()=>import("@/views/sys/main.vue")
      }, 
      {
        path: '/huntfor',
        name: 'huntfor',
        component: ()=>import("@/views/sys/HuntFor.vue")
      }, 
      {
        path: '/announcement',
        name: 'announcement',
        component: ()=>import("@/views/sys/AnnounceDetail.vue")
      }, 
    ]
  },
  {
    path: '/productDetail',
    name: 'productDetail',
    component:  ()=>import("@/views/sys/productDetail.vue")
  },
  {
    path: "/backHome",
    component: ()=>import("@/views/sys/backHome.vue"),
    redirect: "productManage",
    children: [
      {
        path: '/productManage',
        name: 'productManage',
        component: ()=>import("@/views/sys/productManage.vue")
      }, 
      {
        path: '/categoryManage',
        name: 'categoryManage',
        component: ()=>import("@/views/sys/categoryManage.vue")
      }, 
      {
        path: '/editer',
        name: 'editer',
        component: ()=>import("@/views/sys/editer.vue")
      }, 

    ]
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
